package com.koron.common.web.electronicsignature.fegin;

import com.koron.bean.base.Response;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ElectronicSignatureFeignFallback implements FallbackFactory<ElectronicSignatureTicketService> {

    @Override
    public ElectronicSignatureTicketService create(Throwable e) {
        return new ElectronicSignatureTicketService() {
            @Override
            public Response electronicSignatureCallback(String workTicketId, String tenantName, String signStatus) {
                log.error(e.getMessage(), e);
                return Response.fail(e.getMessage());
            }

        };
    }
}